<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    #app {
        text-align: center;
        width: 100%;
        height: 100vh;
    }

    .list {
        /*width: 1200px;*/
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        text-align: justify;
    }
    .list:after {
        content: "";
        width: 10%;
        height: 10px;
    }
    .list-item {
        flex: 1;
    }

    .item-warp {
        width: 200px;
    }
</style>
<body>
<div id="app">
    <input v-model="inputVal">
    <button @click="handleClick">搜索</button>
    <br>
    <div class="list">
        <div class="list-item" v-for="item in list" :key="item.id">
            <div class="item-warp">
                <div>
                    <a> <img :src="item.img"> </a>
                </div>
                <p>
                    <em v-text="item.price"></em>
                </p>
                <p>
                    <a v-html="item.name"></a>
                </p>
                <div>
                    <span>店铺：xxxx </span>
                </div>
                <p>
                    <span>月成交<em>999笔</em></span>
                    <span>评价 <a>500</a></span>
                </p>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.bootcss.com/vue/2.5.2/vue.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            inputVal: "",
            list: [],
        },
        methods: {
            handleClick() {
                this.inputVal && this.search(this.inputVal)
            },
            search(keyword) {
                axios.get('goods/getHighLightData/' + keyword + '/0/20').then(res => {
                    console.log(res.data);
                    this.list = res.data.data;
                    // this.list = res.data;
                })
            }
        },
        // created(){
        //     this.search("java");
        // }


    })
</script>
</body>
</html>